﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MethodWorx.Core.Validation;

namespace MethodWorx.CMS.Workflow
{
    public class WorkflowValidationProvider : IValidationProvider
    {
        private IWorkflowExecutionContext context;
        private bool isValid = true;

        public WorkflowValidationProvider(IWorkflowExecutionContext context)
        {
            this.context = context;
        }

        public bool Validate(object instance)
        {
            return true;
        }

        public void AddError(string key, string message)
        {
            this.isValid = false;
            this.context.AddWorkflowError(key, message);
        }

        public bool IsValid()
        {
            return this.isValid;
        }
    }
}
